home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995…tember: Reference Library / Dev.CD Sep 95 RL / Dev.CD Sep 95 RL.toast / mac / Technical Documentation / develop / develop Issue 20 code / Scripting the Finder / Finder Tricks / Finder Tricks README < prev    next >
Encoding:
Text File  |  1994-10-13  |  4.6 KB  |  129 lines  |  [TEXT/MMCC]

  1. Greg Anderson
  2. October 1994
  3.  
  4.  
  5. About the program "Finder Tricks"
  6. ---------------------------------
  7. Perhaps not as amusing as Letterman (which I never watch),
  8. this sample application will make your Finder do stupid
  9. tricks.
  10.  
  11. WARNING:  The software-engineering-general has determined
  12. that casual use of this program may cause extreme annoyance.
  13. Use only as directed.  Not for resale.
  14.  
  15.  
  16. Okay, what sort of stupid tricks can my Finder do?
  17. --------------------------------------------------
  18. Exchange custom icons of items in front window:  This is the most
  19. annoying trick you can do.  If this button is clicked, then every
  20. item in the frontmost window will be given a custom icon which will
  21. be taken from some other item in the window.  If all of the items
  22. have the same icon, then you won't see anything happen.  If all of
  23. the icons are different, then you'll probably be quite displeased
  24. with the result.  Use the next trick to undo the damage--if you
  25. don't have any custom icons in the window that you'd like to keep!
  26.  
  27. Remove custom icons from selected items:  As the name says, the
  28. custom icons on every selected item are deleted.  They won't come
  29. back, so don't use this on items with custom icons you'd like to
  30. keep around!
  31.  
  32. Reveal owner of frontmost window:  Somewhat useful; shows and selects
  33. the item that belongs to the frontmost window.
  34.  
  35. Share selected folders:  Doesn't work if file sharing isn't turned
  36. on; if sharing is on, then every folder in the current selection
  37. will be shared.
  38.  
  39. Hey, I warned you that these were pretty stupid tricks.  The
  40. goal is to demonstrate how to use the Scriptable Finder; doing
  41. something useful is of secondary importance in this application.
  42.  
  43.  
  44. How the Source is organized
  45. ---------------------------
  46. Finder tricks consists of a number of source files, some of which
  47. stand on their own, and some of which require support from
  48. other files in the project.  It uses the same mini-framework
  49. that I used in Zawphing and some other sample applications
  50. I've written.
  51.  
  52.  
  53. The main files that define the application "Finder Tricks" are:
  54.  
  55. Main.cp                    Initializes the Macintosh toolbox and
  56.                         begins execution of the application.
  57.  
  58. SendFinderTricks.cp        The code that actually sends AppleEvents
  59.                         to the Scriptable Finder.
  60.  
  61. TricksDialog.cp            This code manages the modeless dialog
  62.                         used in this application.
  63.  
  64. MenuTable.cp            A list of function pointers to routines that
  65.                         handle the various menu selections.  If I had
  66.                         a gApplication object and real event dispatching,
  67.                         I wouldn't need this silly table.
  68.  
  69. AboutBox.cp                An important file, despite the fact that
  70.                         it doesn't do very much.
  71.  
  72.  
  73. The "Mini-application framework" is defined by the following
  74. sources:
  75.  
  76.  
  77. EventHandler.cp            Calls WaitNextEvent and dispatches events
  78.                         to the appropriate handlers.
  79.                         
  80. MenuHandler.cp            Manages application menus.  This code is
  81.                         old and rather sub-optimal, but it works
  82.                         well enough for a simple sample app.
  83.  
  84. WindowHandler.cp        Abstract code that defines a set of virtuals
  85.                         that are called by the event handler.  Includes
  86.                         a class for modeless dialog boxes that handles
  87.                         such things as changing the cursor shape to an
  88.                         I-beam when it passes over an EditText item.
  89.  
  90.  
  91. The primary utilities of note are:
  92.  
  93. AppleEventUtilities.cp    A stand-alone set of C++ wrappers for
  94.                         the AppleEvent manager.  Includes useful
  95.                         classes for accessing parameters in
  96.                         records, iterating items in lists, and
  97.                         building descriptors, lists and records.
  98.  
  99. Exceptions.cp            Very useful code that implements a failure
  100.                         handler with Try/Catch semantics.  (No dependancies)
  101.  
  102. ReportError.cp            Code that converts O.S. errors into descriptive
  103.                         strings.  Uses DialogUtilities and StringUtilities.
  104.                         Requires DLOG id 30303 and TEXT id 30303.
  105.  
  106. DialogUtilities.cp        Useful code that helps manage modal and modeless
  107.                         dialog boxes.  Requires StringUtilities.
  108.  
  109. NextEvent.cp            Old code that used to abstract WaitNextEvent
  110.                         vs. GetNextEvent for running on System 6 without
  111.                         MultiFinder (yes, very old code!).  Had some
  112.                         problems with native code, so now it just calls
  113.                         WaitNextEvent directly, and therefore is of
  114.                         marginal value.
  115.                         Uses MacUtilities.cp.
  116.  
  117. MacUtilities.cp            Simple, useful routines that many Macintosh
  118.                         applications will use.  (No dependancies)
  119.  
  120. StringUtilities.cp        Simple code that manages C and Pascal strings.
  121.                         Not as useful as a real string class, but better
  122.                         than nothing.  (No dependancies)
  123.  
  124.  
  125. And, a header not yet in the standard set but used by Finder Tricks:
  126.  
  127. FinderRegistry.h        Defines classes, properties, data types and
  128.                         error codes used by the Scriptable Finder.
  129.